{include file='default/base/mall_top'/}
<link rel="stylesheet" href="{$Think.HOME_SITE_ROOT}/css/home.css">
<div class="header-login clearfix">
    <div class="w1200">
        <div class="logo">
            <a href="{$Think.HOME_SITE_URL}"><img src="{$Think.UPLOAD_SITE_URL}/{$Think.ATTACH_COMMON}/{$Think.config.site_logo}"/></a>
        </div>
    </div>
</div>


<div class="page_register clearfix">
    <div class="w1200">
        <div class="r_icon1"></div>
        <div class="r_icon2"></div>
        <div class="r_icon3"></div>
        <div class="r_icon4"></div>
        <div class="r_icon5"></div>
        <form method="post" id="post_form" action="">
            <div class="register_form">
                <div class="mt">{$Think.lang.account_registratio}</div>
                {if $member.member_id}
                <div class="item clearfix">
                    <div class="label">{$Think.lang.recommender}</div>
                    <div class="item-text">
                        <input name='inviter_id' type='hidden' value='{$member.member_id}'><span>{$member.member_name}</span>
                    </div>
                </div>
                {/if}
                <div class="item clearfix">
                    <div class="label">{$Think.lang.login_register_username}</div>
                    <div class="item-text">
                        <input type="text" id="member_name" name="member_name" class="text" tabindex="1" placeholder="{$Think.lang.login_register_username_to_login}"/>
                    </div>
                </div>
                <div class="item clearfix">
                    <div class="label">
                        {$Think.lang.login_register_pwd}
                    </div>
                    <div class="item-text">
                        <input type="password" id="member_password" name="member_password" class="text" tabindex="1" placeholder=""/>
                    </div>
                </div>
                <div class="item clearfix">
                    <div class="label">
                        {$Think.lang.login_register_ensure_password}
                    </div>
                    <div class="item-text">
                        <input type="password" id="member_password_confirm" name="member_password_confirm" class="text" tabindex="1" placeholder=""/>
                    </div>
                </div>
                {if $Think.config.sms_register == '1'}
                <div class="item clearfix">
                    <div class="label">{$Think.lang.login_mobile_phone}</div>
                    <div class="item-text">
                        <input type="text" id="sms_mobile" name="sms_mobile" class="text" tabindex="1" placeholder="{$Think.lang.agree_upon_registration}" maxlength="11"/>
                    </div>
                </div>
                <div class="item clearfix">
                    <div class="label">{$Think.lang.login_mobile_verification_code}</div>
                    <div class="item-text">
                        <input type="text" id="sms_captcha" name="sms_captcha" class="text" tabindex="1" placeholder="{$Think.lang.login_enter_verification_code}" maxlength="6" style="width:120px;"/>
                        <a class="send_code" id="btn_sms_captcha" ds_type="1">{$Think.lang.login_get_verification_code}</a>
                    </div>
                </div>
                {/if}
                {if $Think.config.captcha_status_register == '1'}
                <div class="item clearfix">
                    <div class="label">{$Think.lang.login_register_code}</div>
                    <div class="item-text">
                        <input type="text" id="captcha_normal" name="captcha_normal" class="text" tabindex="1" placeholder="{$Think.lang.login_register_input_text_in_image}" maxlength="6" style="width:120px;"/>
                        <span class="span">
                            <img style="position: absolute;top: 0;height:46px;" src="{:url('Seccode/makecode')}" title="{$Think.lang.login_index_change_checkcode}" id="sms_codeimage" />
                            <a class="makecode" href="javascript:void(0);" onclick="javascript:document.getElementById('sms_codeimage').src='{:url('Seccode/makecode')}'+'?'+(new Date().getTime());">{$Think.lang.login_password_change_code}</a>
                        </span>
                    </div>
                </div>
                {/if}
                <div class="item clearfix">
                    <div class="label">&nbsp;</div>
                    <div class="item-text">
                        {$Think.lang.agree_upon_registration}<a href='{:url("Document/index",["code"=>"agreement"])}' target='_blank'>{$Think.lang.user_registration_protocol}</a>
                    </div>
                </div>
                <div class="item">
                    <input type="submit" class="btn login-btn" value={$Think.lang.login_register_login_now_4} />
                </div>
            </div>
        </form>
    </div>
</div>


{if $Think.config.sms_register == '1'}
<script type="text/javascript" src="{$Think.HOME_SITE_ROOT}/js/connect_sms.js"></script>
{/if}
<script>
    $(function () {
        $("#post_form").validate({
            errorPlacement: function (error, element) {
                var error_td = element.parent('.item-text');
                error_td.append(error);
                element.parents('.item:first').addClass('error');
            },
            success: function (label) {
                label.parents('.item:first').removeClass('error').find('label').remove();
            },
            rules: {
                member_name: {
                    required: true,
                    minlength: 3,
                    maxlength: 15,
                    remote: {
                        url: HOMESITEURL + '/Login/check_member.html',
                        type: 'get',
                        data: {
                            user_name: function () {
                                return $('#member_name').val();
                            }
                        }
                    }
                },
                member_password: {
                    required: true,
                    minlength: 6,
                    maxlength: 20
                },
                member_password_confirm: {
                    required: true,
                    equalTo: '#member_password'
                },
                {if $Think.config.sms_register == '1'}
                sms_mobile: {
                    required: true,
                    minlength: 11,
                    maxlength: 11
                },
                sms_captcha: {
                    required: true,
                    minlength: 6
                },
                {/if}
                {if $Think.config.captcha_status_register == '1'}
                captcha_normal: {
                    required: true,
                    minlength: 4,
                    remote: {
                        url: "{:url('Seccode/check',['reset'=>'false'])}",
                        type: 'get',
                        data: {
                            captcha: function () {
                                return $('#captcha_normal').val();
                            }
                        },
                        complete: function (data) {
                            if (data.responseText == 'false') {
                                document.getElementById('sms_codeimage').src = "{:url('Seccode/makecode')}"+"?" + new Date().getTime();
                            }
                        }
                    }
                },
                {/if}
            },
            messages: {
                member_name: {
                    required: '<i class="iconfont">&#xe64c;</i>{$Think.lang.login_register_input_username}',
                    minlength: '<i class="iconfont">&#xe64c;</i>{$Think.lang.login_register_username_range}',
                    maxlength: '<i class="iconfont">&#xe64c;</i>{$Think.lang.login_register_username_range}',
                    remote: '<i class="iconfont">&#xe64c;</i>{$Think.lang.login_register_username_exists}'
                },
                member_password: {
                    required: '<i class="iconfont">&#xe64c;</i>{$Think.lang.login_register_input_password}',
                    minlength: '<i class="iconfont">&#xe64c;</i>{$Think.lang.login_register_password_range}',
                    maxlength: '<i class="iconfont">&#xe64c;</i>{$Think.lang.login_register_password_range}'
                },
                member_password_confirm: {
                    required: '<i class="iconfont">&#xe64c;</i>{$Think.lang.login_register_input_password_again}',
                    equalTo: '<i class="iconfont">&#xe64c;</i>{$Think.lang.login_register_password_not_same}'
                },
                {if $Think.config.sms_register == '1'}
                sms_mobile: {
                    required: '<i class="iconfont">&#xe64c;</i>{$Think.lang.login_correct_phone}',
                    minlength: '<i class="iconfont">&#xe64c;</i>{$Think.lang.login_correct_phone}',
                    maxlength: '<i class="iconfont">&#xe64c;</i>{$Think.lang.login_correct_phone}'
                },
                sms_captcha: {
                    required: '<i class="iconfont">&#xe64c;</i>{$Think.lang.login_sms_dynamic_code}'
                    minlength: '<i class="iconfont">&#xe64c;</i>{$Think.lang.login_sms_dynamic_code}'
                },
                {/if}
                {if $Think.config.captcha_status_register == '1'}
                captcha_normal: {
                    required: '<i class="iconfont">&#xe64c;</i>{$Think.lang.login_index_input_checkcode}',
                    minlength: '<i class="iconfont">&#xe64c;</i>{$Think.lang.login_index_wrong_checkcode}',
                    remote: '<i class="iconfont">&#xe64c;</i>{$Think.lang.login_index_wrong_checkcode}'
                },
                {/if}
            }
        });
    });

</script>
{include file='default/base/mall_footer'/}